Skip to content

Conversation

sffc
Copy link
Collaborator

@sffc sffc commented Oct 3, 2025

This is intentional, but it looks like a bug when implementing, so it's worth calling out.

@sffc sffc changed the title Add note about hard-coded overflow constrain Editorial: Add note about hard-coded overflow constrain Oct 3, 2025
Copy link

codecov bot commented Oct 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.91%. Comparing base (a3bc92f) to head (c3e103c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3162   +/-   ##
=======================================
  Coverage   96.91%   96.91%           
=======================================
  Files          22       22           
  Lines       10209    10209           
  Branches     1839     1839           
=======================================
  Hits         9894     9894           
  Misses        266      266           
  Partials       49       49           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@justingrant justingrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One one minor (and optional) question.

1. If _sign_ × (_d1_ - _isoDate2_.[[Day]]) > 0, return *true*.
1. Return *false*.
</emu-alg>
<emu-note>This operation intentionally uses overflow ~constrain~ when regulating the year-month.</emu-note>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth explaining why we use ~constrain~ here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I can clearly explain why. It's just a choice we made for how the algorithm works. There are other choices that could have been made.

Do you want to try?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that @ptomato may have more recent knowledge than I do about this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it was actually added by @sffc here: #3138

It's been too long since I read Shane's proof in the comments of that PR, so I don't have context on it anymore.

Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me either with or without the additional comment. I'd normally love to contribute the additional comment but I'm unfortunately short on time right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants